package com.cssy.xxkj.basic.dao.impl;

import java.util.List;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.cssy.xxkj.basic.dao.BasicStorageInfoTestDAO;
import com.cssy.xxkj.basic.entity.BasicStorageInfoTestDO;
import com.plat.helper.SearchConditions;

/**
 * 数据访问对象实现类
 * @since 2014-09-04
 */
public class BasicStorageinfoTestDAOImpl extends SqlMapClientDaoSupport implements BasicStorageInfoTestDAO {

    /**
     * 插入数据
     * @param basicStorageinfoTestDO
     * @return 插入数据的主键
     */
    public void insertBasicStorageinfoTestDO(BasicStorageInfoTestDO basicStorageinfoTestDO) throws DataAccessException {
        getSqlMapClientTemplate().insert("BasicStorageinfoTest.insert", basicStorageinfoTestDO);
    }

    /**
     * 统计记录数
     * @param basicStorageinfoTestDO
     * @return 查出的记录数
     */
    public Integer countBasicStorageinfoTestDOByExample(BasicStorageInfoTestDO basicStorageinfoTestDO) throws DataAccessException {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("BasicStorageinfoTest.countByDOExample", basicStorageinfoTestDO);
        return count;
    }

    /**
     * 获取对象列表
     * @param basicStorageinfoTestDO
     * @return 对象列表
     */
    @SuppressWarnings("unchecked")
    public List<BasicStorageInfoTestDO> findListByExample(BasicStorageInfoTestDO basicStorageinfoTestDO) throws DataAccessException {
        List<BasicStorageInfoTestDO> list = getSqlMapClientTemplate().queryForList("BasicStorageinfoTest.findListByDO", basicStorageinfoTestDO);
        return list;
    }

	@Override
	public List<BasicStorageInfoTestDO> find(SearchConditions scs) throws DataAccessException {
		List<BasicStorageInfoTestDO> list = getSqlMapClientTemplate().queryForList("BasicStorageinfoTest_ex.find", scs);
        return list;
	}

	@Override
	public Integer count(SearchConditions scs) throws DataAccessException {
		Integer count = (Integer) getSqlMapClientTemplate().queryForObject("BasicStorageinfoTest_ex.count", scs);
        return count;
	}

	@Override
	public Integer deleteBizRemoved(String id) throws DataAccessException {
		int result = (Integer)getSqlMapClientTemplate().queryForObject("BasicStorageinfoTest_ex.deleteBizRemoved", id);
        return result;
	}

	@Override
	public Integer updateBasicStorageinfoTestDO(
			BasicStorageInfoTestDO basicStorageinfoTestDO)
			throws DataAccessException {
		int result = getSqlMapClientTemplate().update("BasicStorageinfoTest.update", basicStorageinfoTestDO);
        return result;
	}

	@Override
	public BasicStorageInfoTestDO findBasicStorageinfoTestDOByPrimaryKey(
			String id) throws DataAccessException {
		BasicStorageInfoTestDO basicStorageinfoTestDO = (BasicStorageInfoTestDO) getSqlMapClientTemplate().queryForObject("BasicStorageinfoTest.findByPrimaryKey", id);
        return basicStorageinfoTestDO;
	}

	@Override
	public Integer deleteBasicStorageinfoTestDOByPrimaryKey(String id)
			throws DataAccessException {
		Integer rows = (Integer) getSqlMapClientTemplate().delete("BasicStorageinfoTest.deleteByPrimaryKey", id);
        return rows;
	}

}